package com.tengfei.reflection;

import java.lang.reflect.Field;

/**
 * @Description:
 * @author: ten_fei
 * @date: 2021-07-15 15:10
 */
public class Test6 {
    public static void main(String[] args) throws ClassNotFoundException {
        Class c1 = Class.forName("com.tengfei.reflection.User");

        System.out.println(c1.getName());
        System.out.println(c1.getSimpleName());

        Field[] fields = c1.getFields();
//        for (Field field : fields) {
//            System.out.println(field);
//        }
        Field[] declaredFields = c1.getDeclaredFields();
        for (Field declaredField : declaredFields) {
            System.out.println(declaredField);
        }
    }
}
